<div class="row">
	<div class="col-xs-12 col-md-12">
		<!-- widgets part -->
		<div class="widget">
			<div class="widget-header bordered-bottom bordered-themeprimary">
				<i class="widget-icon fa fa-tasks themeprimary"></i>
				<span class="widget-caption themeprimary">订单详情</span>
				<div class="widget-buttons buttons-bordered">
					<%= button_to '编辑', edit_purchase_order_path(@purchase_order), method: :get, :class => "btn btn-blue btn-xs" %>
				</div>
				<div class="widget-buttons buttons-bordered">
					<%= button_to '返回', purchase_orders_path, method: :get, :class => "btn btn-blue btn-xs" %>
				</div>

			</div><!--Widget Header-->
			<div class="widget-body">
				<div class="widget-main no-padding">

					<p id="notice">
						<%= notice %>
					</p>
					<div class="row">
						<div class="col-md-6">
							<strong>Po number:</strong>
							<%= @purchase_order.po_number %>
						</div>
						<div class="col-md-6">
							<strong>Supplier:</strong>
							<%= @purchase_order.supplier_name %>
						</div>
					</div>

					<div class="row">
						<div class="col-md-6">
							<strong>Date:</strong>
							<%= @purchase_order.date %>
						</div>
						<div class="col-md-6">
							<strong>Payment term:</strong>
							<%= @purchase_order.payment_term %>
						</div>
					</div>

					<div class="row">
						<div class="col-md-6">
							<strong>Amount:</strong>
							<%= @purchase_order.amount %>
						</div>
						<div class="col-md-6">
							<strong>Invoice state:</strong>
							<%= @purchase_order.invoice_state %>
						</div>
					</div>

					<div class="row">
						<div class="col-md-6">
							<strong>Invoice no:</strong>
							<%= @purchase_order.invoice_no %>
						</div>
						<div class="col-md-6">
							<strong>Invoice amount:</strong>
							<%= @purchase_order.invoice_amount %>
						</div>
					</div>

					<div class="row">
						<div class="col-md-6">
							<strong>Invoice received date:</strong>
							<%= @purchase_order.invoice_received_date %>
						</div>
						<div class="col-md-6">
							<strong>Amount paid:</strong>
							<%= @purchase_order.amount_paid %>
						</div>
					</div>

					<div class="row">
						<div class="col-md-6">
							<strong>Balance:</strong>
							<%= @purchase_order.balance %>
						</div>
						<div class="col-md-6">

						</div>
					</div>

				</div><!--Widget Main Container-->
			</div><!--Widget Body-->
		</div>

		<div class="widget">
			<div class="widget-header bordered-bottom bordered-themeprimary">
				<i class="widget-icon fa fa-tasks themeprimary"></i>
				<span class="widget-caption themeprimary">付款详情</span>
				<div class="widget-buttons buttons-bordered">
					<%= button_to '添加付款信息', new_purchase_order_po_payment_path(@purchase_order), method: :get, :class => "btn btn-blue btn-xs" %>
				</div>
			</div><!--Widget Header-->
			<div class="widget-body">
				<div class="widget-main no-padding">

					<table class="table table-bordered table-striped table-condensed flip-content">
						<thead class="flip-content bordered-palegreen">
							<tr>
								<th>付款金额</th>
								<th>付款日期</th>
								<th>备注</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							<% @purchase_order.po_payments.each do |po_payment| %>
							<tr>
								<td><%= po_payment.amount %></td>
								<td><%= po_payment.date %></td>
								<td><%= po_payment.remarks %></td>
								<td><%= link_to 'Destroy', purchase_order_po_payment_path(@purchase_order,po_payment), method: :delete, data: { confirm: 'Are you sure?' } %></td>
							</tr>
							<% end %>

						</tbody>
					</table>

				</div><!--Widget Main Container-->
			</div><!--Widget Body-->
		</div>

		<!-- widgets part -->
	</div>

</div>
